<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>DNA翻译成蛋白质工具</title>
		<link charset="utf-8" rel="stylesheet" href="__PUBLIC__/static/asset/bootstrap/3.3.6/css/bootstrap.min.css">
		
        <style>
        	.no-padding-right{
        		padding-right : 0!important;
        	}
        	.no-padding-left{
        		padding-left: 0!important;
        	}
            .jumbotron{
            	padding-top: 15px !important;
            	padding-bottom: 15px !important;
            }
            .memo{
                color: #aaa;
            }
            .text-left-important{
                text-align: left !important;
            }
        </style>
	</head>
	<body>
		<div class="container-fluid">
			<div class="row">
				<div class="jumbotron">
					<h4><a href="{:config('base')}/index.php"><i class="glyphicon glyphicon-home"></i></a> DNA翻译成蛋白质序列工具
                        <a href="#" title="软件使用说明" data-toggle="modal" data-target="#help-modal"><i class="glyphicon glyphicon-question-sign"></i></a>
                    </h4>

                    <form id="form-antisense-dna" action="{:url('result_dna_translate')}" method="post" class="form-horizontal" onsubmit="return false;">
                        <div class="form-group">
                            <div class="col-md-10 col-sm-10 col-xs-10 no-padding-left no-padding-right">
                                <div class="input-group">
                                    <span class="input-group-addon">5'</span>
                                    <input type="text" name="dna" class="form-control" id="dna">
                                    <span class="input-group-addon">3'</span>
                                </div>
                            </div>
                            <div class="col-md-1  col-sm-2 col-xs-12">
                                <button type="button" class="calculate-button btn btn-primary pull-right" data-form="form-antisense-dna"> 转换 </button>
                            </div>
                        </div>
                    </form>
				  <div id="message-show" class="alert alert-danger hidden" role="alert">警告内容</div>
				</div>
				<!--
                	/.col-md-12
                -->
			</div>
			<!-- /.row -->
			
			<div class="row">
				<div id="result-show" class="col-md-12 hidden">
					<div class="body" id="result-body"></div>
				</div>
			</div>
		</div>

        <div class="modal fade" id="help-modal">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title">DNA转换为蛋白序列</h4>
                    </div>
                    <div class="modal-body">
                        <div>
                            1.输入DNA或RNA序列。左边为5'端，右边为3'端<br>
                            2.软件从5'端第一个碱基开始翻译得到：5'-3'序列1；
                            从5'端第二个碱基开始翻译得到：5'-3'序列2；
                            从5'端第三个碱基开始翻译得到：5'-3'序列3；
                            从3'端第一个碱基开始翻译得到：3'-5'序列1；
                            从3'端第二个碱基开始翻译得到：3'-5'序列2；
                            从3'端第三个碱基开始翻译得到：3'-5'序列3。<br>
                            3.如果翻译后的序列中含有*，其*代表终止密码。<br>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">确定</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->


		<script type="text/html" id="result_template">
			<div class="col-md-12">
                {{# for(var i=0, len=d.sequence1.length; i < len; i++){ }}
				<div class="col-md-12"><b>5'-3'序列{{i+1}}</b></div>
				<div class="col-md-12">
                   {{d.sequence1[i]}}
				</div>
                <div class="col-md-12">&nbsp;</div>
                {{# } }}
			</div>
            <div class="col-md-12">
                {{# for(var i=0, len=d.sequence2.length; i < len; i++){ }}
                <div class="col-md-12"><b>3'-5'序列</b>{{i+1}}</div>
                <div class="col-md-12">
                    {{d.sequence2[i]}}
                </div>
                <div class="col-md-12">&nbsp;</div>
                {{# } }}
            </div>
		</script>

		<script src="__PUBLIC__/static/sea.js"></script>
		<script src="__PUBLIC__/static/skin/default/config.js"></script>
		
		<script>
			seajs.use('skin/default/dna_translate', function(tool){
                tool.initCalculate();
			})
		</script>
	</body>
</html>
